import { NgModule } from '@angular/core';
import { RouterModule, Routes} from '@angular/router';
import { AllProblemComponent} from "./problems/all-problem/all-problem.component";
import { ProblemSetsComponent} from "./problem-sets/problem-sets.component"
import { ProblemsComponent} from "./problem-sets/problems/problems.component"
import { NewComponent} from "./problems/type/6/new/new.component"
import { TypeComponent} from "./problems/type/type.component"
import { NewSetsComponent} from "./problem-sets/new/new.component";
import { UserInfoComponent} from "./user/user-info/user-info.component";
import { UserGroupsComponent } from './user/user-groups/user-groups.component';
import { EditUserGroupComponent } from './user/user-groups/edit/edit-user-group.component';
import { NewUserGroupComponent } from './user/user-groups/new/new-user-group.component';
import { SubmissionsComponent } from './problem-sets/submissions/submissions.component';
import { RankingsComponent } from './problem-sets/rankings/rankings.component';
import { UserLoginComponent} from "./user/user-login/user-login.component";
import { UserForgetComponent} from "./user/user-forget/user-forget.component";
import { UserManagerComponent} from "./user/user-manager/user-manager.component";
import { HomeComponent} from "./home/home.component";
import { HomeManagerComponent} from "./home/home-manager/home-manager.component";

const routes: Routes = [
  { path: '', redirectTo: '/home', pathMatch: 'full'},
  { path: 'home', component: HomeComponent},
  { path: 'home2', component: HomeComponent},
  { path: 'home/homeManger', component: HomeManagerComponent},
  { path: 'problem-sets', component: ProblemSetsComponent},
  { path: 'problem-sets2', component: ProblemSetsComponent},
  { path: 'problem-sets/newCategory/:id', component: NewSetsComponent},
  { path: 'problem-sets/update/:id/:id', component: NewSetsComponent},
  { path: 'problem-sets/id/problems', component: ProblemsComponent},
  { path: 'problems/type/6/new', component: NewComponent},
  { path: 'problems/type/6/new/:id', component: NewComponent},
  { path: 'problems/type/:id', component: TypeComponent},
  { path: 'problem-sets/:id/problems', component: ProblemsComponent},
  { path: 'problem-sets/:id/problems/:id', component: ProblemsComponent},
  { path: 'problem-sets/:id/submissions', component: SubmissionsComponent},
  { path: 'problem-sets/:id/rankings', component: RankingsComponent},
  { path: 'user/user-login', component: UserLoginComponent},
  { path: 'user/user-forget', component: UserForgetComponent},
  { path: 'user/user-forget/', component: UserForgetComponent},
  { path: 'user/user-forget/:id', component: UserForgetComponent},
  { path: 'user/userInfo', component: UserInfoComponent},
  { path: 'user/userGroups', component: UserGroupsComponent},
  { path: 'user/userGroups/new', component: NewUserGroupComponent},
  { path: 'user/userGroups/:id/edit', component: EditUserGroupComponent},
  { path: 'user/userManager', component: UserManagerComponent},
  {
    path: 'problem-sets',
    component: ProblemSetsComponent,
    children:[{
      path: ':id/problems',
      component: ProblemsComponent,
      children:[{
        path: ':id',
        component: ProblemsComponent,

      }]
    }]
  },
];

@NgModule({
  imports: [ RouterModule.forRoot(routes)],
  exports: [ RouterModule ],
})


export class AppRoutingModule { }
